/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#include "Types.h"

#include "TypeObject.h"

int type_object_bind( type_object * object, type_library * library, type_name * name )
{
	type_definition * definition;
	
	definition = type_library_get_definition( library, name );
	if ( definition == NULL )
		return type_library_get_error( library );
	
	object->definition = definition;
	
	return TYPE_OK;
}


type_element * type_object_element( type_object * object )
{
	return object->definition->structure;
}

type_name * type_object_name( type_object * object )
{
	return object->definition->name;
}

type_library * type_object_library( type_object * object )
{
	return object->definition->library;
}

int type_object_id( type_object * object )
{
	return object->definition->id;
}

